devise routes and index page

jamesperet 9 years ago
parent
commit
9e98b1d684

+ 3 - 0
app/assets/javascripts/start.js.coffee

@@ -0,0 +1,3 @@
1
+# Place all the behaviors and hooks related to the matching controller here.
2
+# All this logic will automatically be available in application.js.
3
+# You can use CoffeeScript in this file: http://coffeescript.org/

+ 3 - 0
app/assets/stylesheets/start.css.less

@@ -0,0 +1,3 @@
1
+// Place all the styles related to the start controller here.
2
+// They will automatically be included in application.css.
3
+// You can use Less here: http://lesscss.org/

+ 4 - 0
app/controllers/start_controller.rb

@@ -0,0 +1,4 @@
1
+class StartController < ApplicationController
2
+  def index
3
+  end
4
+end

+ 2 - 0
app/helpers/start_helper.rb

@@ -0,0 +1,2 @@
1
+module StartHelper
2
+end

+ 1 - 0
app/views/layouts/_logo.html.erb

@@ -0,0 +1 @@
1
+<a class="brand" href="/">Website Template</a>

+ 2 - 1
app/views/layouts/application.html.erb

@@ -46,7 +46,8 @@
46 46
             <span class="icon-bar"></span>
47 47
             <span class="icon-bar"></span>
48 48
           </a>
49
-          <a class="brand" href="#">RailsWebsiteTemplate</a>
49
+          <%= render 'layouts/logo' %>
50
+
50 51
           <div class="container nav-collapse">
51 52
             <ul class="nav">
52 53
               <li><%= link_to "Link1", "/path1"  %></li>

+ 2 - 0
app/views/start/index.html.erb

@@ -0,0 +1,2 @@
1
+<h1>Start#index</h1>
2
+<p>Find me in app/views/start/index.html.erb</p>

+ 30 - 1
config/routes.rb

@@ -1,5 +1,33 @@
1 1
 RailsWebsiteTemplate::Application.routes.draw do
2
-  devise_for :users
2
+  
3
+  get "start/index"
4
+  devise_for :users, :skip => [:sessions, :passwords, :confirmations, :registrations]
5
+  as :user do
6
+    get 'login' => 'devise/sessions#new', :as => :new_user_session
7
+    post 'login' => 'devise/sessions#create', :as => :user_session
8
+    delete 'logout' => 'devise/sessions#destroy', :as => :destroy_user_session
9
+    get   'signup' => 'devise/registrations#new',    :as => :new_user_registration
10
+    post  'signup' => 'users/registrations#create', :as => :user_registration
11
+    put  'signup' => 'devise/registrations#update', :as => :user_registration_update
12
+    scope '/account' do
13
+        # password reset
14
+        get   '/reset-password'        => 'devise/passwords#new',    as: 'new_user_password'
15
+        put   '/reset-password'        => 'devise/passwords#update', as: 'user_password'
16
+        post  '/reset-password'        => 'devise/passwords#create'
17
+        get   '/reset-password/change' => 'devise/passwords#edit',   as: 'edit_user_password'
18
+        # confirmation
19
+        get   '/confirm'        => 'devise/confirmations#show',   as: 'user_confirmation'
20
+        post  '/confirm'        => 'devise/confirmations#create'
21
+        get   '/confirm/resend' => 'devise/confirmations#new',    as: 'new_user_confirmation'
22
+        # settings & cancellation
23
+        get '/cancel'   => 'devise/registrations#cancel', as: 'cancel_user_registration'
24
+        get '/settings' => 'devise/registrations#edit',   as: 'edit_user_registration'
25
+        put '/settings' => 'devise/registrations#update'
26
+        # account deletion
27
+        delete '' => 'devise/registrations#destroy'
28
+    end
29
+  end
30
+  
3 31
   # The priority is based upon order of creation: first created -> highest priority.
4 32
   # See how all your routes lay out with "rake routes".
5 33
 
@@ -54,4 +82,5 @@ RailsWebsiteTemplate::Application.routes.draw do
54 82
   #     # (app/controllers/admin/products_controller.rb)
55 83
   #     resources :products
56 84
   #   end
85
+  root 'start#index'
57 86
 end

+ 9 - 0
test/controllers/start_controller_test.rb

@@ -0,0 +1,9 @@
1
+require 'test_helper'
2
+
3
+class StartControllerTest < ActionController::TestCase
4
+  test "should get index" do
5
+    get :index
6
+    assert_response :success
7
+  end
8
+
9
+end

+ 4 - 0
test/helpers/start_helper_test.rb

@@ -0,0 +1,4 @@
1
+require 'test_helper'
2
+
3
+class StartHelperTest < ActionView::TestCase
4
+end